UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HgqxosGaq/u2KPeylVU8No9F4dcBxMoJr+Z+QPySmg0=' 
WHERE 
  key_id = '0f3a1053ec312d592f810ba102a3b47d08f990ee6ee0702ea159117dc1cca230' 
  AND (
    token = 'HgqxosGaq/u2KPeylVU8No9F4dcBxMoJr+Z+QPySmg0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024