UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8X8B8JZR0d3suz1PXerEJFlzOmxnVMNbX5rGdQahayg='
WHERE
key_id = 'efbd999cd9c8600f9c539d1374382e9e2b81b00756f33773f23d4f3492259f90'
AND (
token = '8X8B8JZR0d3suz1PXerEJFlzOmxnVMNbX5rGdQahayg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)