UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJ7oIlUYTIjjsNa3ukOc0gBkxr0231PrDc461lwfFlA='
WHERE
key_id = '09411d9a37b13df0c8397f58e19f4e9b2ed7ad9509ed19542e074fe13748d546'
AND (
token = 'MJ7oIlUYTIjjsNa3ukOc0gBkxr0231PrDc461lwfFlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)