UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZfmAllVOcXnxdmF1kYDITqxK6Vq6bx1TygJKYR7lO8='
WHERE
key_id = '3e325bfcafd3d613862fc6f119e9fe22dd8351fb642369d3ea3d1e1255fb76cb'
AND (
token = 'DZfmAllVOcXnxdmF1kYDITqxK6Vq6bx1TygJKYR7lO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)