UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vsyxHJPV+NtXEwbePo55zvVKb5QfTZ5X+79lLoIcUSg=' 
WHERE 
  key_id = '911ae9cbbda9179969d3c218b418169cb747db878d23ed6a165126195e9eb0b7' 
  AND (
    token = 'vsyxHJPV+NtXEwbePo55zvVKb5QfTZ5X+79lLoIcUSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032