UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E4xR0O6dFt4T0zshuX/mh+pThTYhWMi1udNQz9aa3Bc='
WHERE
key_id = 'eb2128ceb44de6da6a682451c99cef8a2c505d9c259d2ce80753c248c6686a6b'
AND (
token = 'E4xR0O6dFt4T0zshuX/mh+pThTYhWMi1udNQz9aa3Bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)