UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kJKuGya28iy6/CkdmfYAf8CydpJ6INO5wcBkIGwsoVk='
WHERE
key_id = '37479cbfdf969adbdb5ff24219ffb0ee8b6541ac2305b9aa1e5514ae5dbbe5e9'
AND (
token = 'kJKuGya28iy6/CkdmfYAf8CydpJ6INO5wcBkIGwsoVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)