UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mAp9DgPJl4rGaRJl19Xhl5YawxUtjOs174dpmoMHtGQ='
WHERE
key_id = '7b64f916301956fdc5f1d0b789187e59a60c43ff3e155864177a3136801c373e'
AND (
token = 'mAp9DgPJl4rGaRJl19Xhl5YawxUtjOs174dpmoMHtGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)