UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K0OLVe4IUuDyJC7t8jVQBfIWUkdlfM+7twEGTtXwR4I=' 
WHERE 
  key_id = 'f3c108650a0fb8d279bba34b094684cded43f9c76992e7b7810d7e2ebcd39e71' 
  AND (
    token = 'K0OLVe4IUuDyJC7t8jVQBfIWUkdlfM+7twEGTtXwR4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033