UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qbWoeqxDfNwnwncym2PzGylbv14kMd5Tr5g/uo/GQRE=' 
WHERE 
  key_id = 'b481a364eb173b44812716ecda48233449e97e4596656d719c581fcba9fdc633' 
  AND (
    token = 'qbWoeqxDfNwnwncym2PzGylbv14kMd5Tr5g/uo/GQRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041