UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MI0XPtS5kBfmApStreblrKj0tkP7TY3HrfxTK60JoYY=' 
WHERE 
  key_id = 'adcb5a5008b36b862a0b46b538226fdded321db6b278d475a3dbd4b4255b7d2d' 
  AND (
    token = 'MI0XPtS5kBfmApStreblrKj0tkP7TY3HrfxTK60JoYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040