UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8C4/CNIDW0a/ZAPaXQBUdqzg3QzplBP2naFQ8U+kDvU='
WHERE
key_id = '15ab455f9070b4d196f9cdcd97a8095fc70e9124daffe26c338ff7066d4750a7'
AND (
token = '8C4/CNIDW0a/ZAPaXQBUdqzg3QzplBP2naFQ8U+kDvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)