UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iBeXXeRKixbjdXFStmELzcjQCR2ghuCxWZFn7qaoIrg=' 
WHERE 
  key_id = 'df077551127f4f3a913315c55482d8010ddfdb9c2e7d1be32f00ca143cdb6f3e' 
  AND (
    token = 'iBeXXeRKixbjdXFStmELzcjQCR2ghuCxWZFn7qaoIrg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034