UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jD7jYbSJBmd2gTO3EbQSM2Ju8qbF6Jfq96j8zjFqKlY='
WHERE
key_id = 'd085110c1172c72ac91a9aa39be280c24ba60b7a634e514a5b59b09633694fbf'
AND (
token = 'jD7jYbSJBmd2gTO3EbQSM2Ju8qbF6Jfq96j8zjFqKlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)