UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UF27GXBLvlrD+2YXaEMJMp5pKvBKxXpPySYj1xFdrzY=' 
WHERE 
  key_id = '7c27fe793079cb048ae03586c36ab4552c1d21d75c02eb3cfe6cb062023a4ca2' 
  AND (
    token = 'UF27GXBLvlrD+2YXaEMJMp5pKvBKxXpPySYj1xFdrzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056