UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HRkwP3dgFecJDNBek0UZLzSNfk9NuK7YrsxsfwcVgic='
WHERE
key_id = '4b96a3302c989962fb98e31c8831561b8795a8b710f553a40a59f6b23a2fc65c'
AND (
token = 'HRkwP3dgFecJDNBek0UZLzSNfk9NuK7YrsxsfwcVgic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)