UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rd2L5m/qvKut2t8OZyYrj6Dxv7Dbkd4Ijv6G5b3TLaE='
WHERE
key_id = 'fa5c701cd706186bf0428c225577b38d895cd5f3b90638a6d4b2936a5fcd5917'
AND (
token = 'Rd2L5m/qvKut2t8OZyYrj6Dxv7Dbkd4Ijv6G5b3TLaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)