UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nNGgP40gpp0d4SL8VgF3+AVFU5dXOIrNdClEl7Gs56M='
WHERE
key_id = 'a411726f9686b6e9fad71ec3934db0c253dac9eaa4ba058a09c5308c023b6abb'
AND (
token = 'nNGgP40gpp0d4SL8VgF3+AVFU5dXOIrNdClEl7Gs56M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)