UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EL/wh8r59bTGroDKMBdhxsbvRTP/HwwAF7O2j8YzQ78=' 
WHERE 
  key_id = '348e84d34dcc1610500a0db1a3e9441e885df00e8048c6c88c8b60fec7894ad0' 
  AND (
    token = 'EL/wh8r59bTGroDKMBdhxsbvRTP/HwwAF7O2j8YzQ78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025