UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZFgNZTQJnnUgOmiU6PioWIIkobdccxSegacNpxs6+I='
WHERE
key_id = 'daad02fdfbc957dc83effa319a8d7208cdc2aba555c3dfec7a9a7b6f6e28e3c1'
AND (
token = 'yZFgNZTQJnnUgOmiU6PioWIIkobdccxSegacNpxs6+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)