UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PXk+D5ZB5h7YLrnPxY7wsYJ7Gk+1pZIOpXBuJN/dbgw=' 
WHERE 
  key_id = 'b9357cba31ea7a43642c4557c8a432f0169a71881246fd744195fc1bc0362de2' 
  AND (
    token = 'PXk+D5ZB5h7YLrnPxY7wsYJ7Gk+1pZIOpXBuJN/dbgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031