UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hiu4kDWd5B8Rzs9akhU/bug9VJ6gPhuogY57YbiIPsU='
WHERE
key_id = 'bf424b94499c6ab880fb36ad3d5a5bc286dbcde3b1711867b6e0d6a99db7faae'
AND (
token = 'hiu4kDWd5B8Rzs9akhU/bug9VJ6gPhuogY57YbiIPsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)