UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rlYFtlD2xVmTjGc8S6D85MbXUbiXRH4Rw4brlCVATKQ='
WHERE
key_id = '6f09c576665b94ef434dd97cc75700036a5d9dc1361b8c1eef43387b88c39513'
AND (
token = 'rlYFtlD2xVmTjGc8S6D85MbXUbiXRH4Rw4brlCVATKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)