UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y5jv4cK2t9+RZT6nd/j0mgNcLVm986UQ0vbANbyi2xE='
WHERE
key_id = 'c811ca74055384ae32e12f1a1978b5adf09b5cf6ac1a9ff5092bec12527ccc74'
AND (
token = 'y5jv4cK2t9+RZT6nd/j0mgNcLVm986UQ0vbANbyi2xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)