UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iDpM24VcRQr201J7f3p8o3rpQ3nHUhLjY+1vyF5ncbc='
WHERE
key_id = 'acc53cf101c00fc63a50a393d10fab0dd4a034e64e1d84110883494f7aa7f974'
AND (
token = 'iDpM24VcRQr201J7f3p8o3rpQ3nHUhLjY+1vyF5ncbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)