UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X8pFSiOcbU2Q7PgZVTzcU2+ooXzIa2y0Z19i97YRgbg='
WHERE
key_id = '26c7bda463893fc8e430201b0dc4bb48058add08d11fbcb59874308fba189e0e'
AND (
token = 'X8pFSiOcbU2Q7PgZVTzcU2+ooXzIa2y0Z19i97YRgbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)