UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xJLs/vr6Ub7a/eISZHDkEOQDQ7MAfiWlSbCNjMsiRLk=' 
WHERE 
  key_id = '7eb3cdaa77fdadfe7c499345d029910a6c36a2b19a5a1fe25631bf9d5e6e58cc' 
  AND (
    token = 'xJLs/vr6Ub7a/eISZHDkEOQDQ7MAfiWlSbCNjMsiRLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047