UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ooEfIxGhuAS8kvRs2AkJxC8saPG/D8/dGg3Go82N6Gs='
WHERE
key_id = 'ab55bb24dbfc6f1603f5b1452fd474b745a644414670746962ef982f77207aa8'
AND (
token = 'ooEfIxGhuAS8kvRs2AkJxC8saPG/D8/dGg3Go82N6Gs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)