UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PoEjCT+cxk6Fx43iYYhxdPBiJSWEW9fy9gcGVEMK0NY='
WHERE
key_id = '66906de63ef4af21e122a2abaee89232c0b5255995ade16983a5126681109c27'
AND (
token = 'PoEjCT+cxk6Fx43iYYhxdPBiJSWEW9fy9gcGVEMK0NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)