UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Peg+lbw+eBMunf/ASq4fiUFCDFKWFA0iIexZ7YjPDHA='
WHERE
key_id = 'f2d664fc7206d4861116f3e266229e010eb4e302ffa1e0ca97d75c224292079a'
AND (
token = 'Peg+lbw+eBMunf/ASq4fiUFCDFKWFA0iIexZ7YjPDHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)