UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gPcoMHG0wu8erbrakRCGww4Ukb74iULlR2NOLtNSc/I='
WHERE
key_id = '99439542e86c39647c5cc032c57b2463c972620f411886c197b7c89f15a2edec'
AND (
token = 'gPcoMHG0wu8erbrakRCGww4Ukb74iULlR2NOLtNSc/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)