UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q8kHH2Ds4SvBbEOZG8dZflDrUVNhxS1Nekh0bxQqEkg='
WHERE
key_id = '86d59728ba532e0c502277fd789fa56f74c674aae084e6decca0ece1c9f3e548'
AND (
token = 'q8kHH2Ds4SvBbEOZG8dZflDrUVNhxS1Nekh0bxQqEkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)