UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oVVtoJXQasoAwaHtOpkV9I9njEmdEPe12RBJgiLXStw='
WHERE
key_id = 'ef4b806e4f0c387ec5b5ea28ac7d47d99a0ee47714d230a3e477e7753781305d'
AND (
token = 'oVVtoJXQasoAwaHtOpkV9I9njEmdEPe12RBJgiLXStw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)