UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/oGzQU1luC4razrD3X4jtdfdbgwRTJDoHYzeGNoV1dU='
WHERE
key_id = '68d0b47e5581f88be3a7b8375a194a5bb6547be3b8c86b875f00fdd0008947cf'
AND (
token = '/oGzQU1luC4razrD3X4jtdfdbgwRTJDoHYzeGNoV1dU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)