UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JjLslUrNgjhYCzuvW1TrBy3bM1SK+5XEG3HRRZM36I=' 
WHERE 
  key_id = 'dab4f0ce99f81cbc4c136be6018e7656940cf952ec7fa475e4cd3cd4a5b19afd' 
  AND (
    token = '5JjLslUrNgjhYCzuvW1TrBy3bM1SK+5XEG3HRRZM36I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027